<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>出发吧</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/common/include_js.jsp" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/bsn.AutoSuggest_2.1.3.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/front/css/css.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/css/autosuggest_inquisitor.css" />
</head>
<body>
<div id="wrap">

  <div id="main">
  	<div id="flight_left">
      <div class="flight">
        <div class="searchBox flightSearch china">
          <div class="search_title">
            <h2 id="search_internal" class="Default"><span>国内机票</span></h2>
          </div>
          <div class="boxpad">
          	<form action="<%=request.getContextPath() %>/front/order!flightSearch.action?t=1" method="post" id="subForm">
          	<input type="hidden" name="fromCity" id="_fromCity" value="" />
          	<input type="hidden" name="toCity" id="_toCity" value="" />
          	<input type="hidden" name="isTj" id="_isTj" value="" />
          	<input type="hidden" name="viaPort" id="_viaPort" value="" />
          	
            <table cellspacing="0" cellpadding="0" class="tblSearch">
              <tbody>
                <tr>
                  <th><span class="t">方式</span></th>
                  <td><div class="methodWrap">
                      <input type="radio" class="radio" name="flyType" value="1" onclick="javascript:changeFlyType(1);" checked="checked" />
                      <label for="searchTypeSng">单程</label>
                      <input type="radio" class="radio" name="flyType" value="2" onclick="javascript:changeFlyType(2);" />
                      <label for="searchTypeRnd">往返</label>
                    </div></td>
                </tr>
                <tr style="display:none;">
                  <th><span class="t">&nbsp;</span></th>
                  <td><div class="methodWrap">
                      <input type="checkbox" id="isTj" class="radio">
                      <label for="searchTypeSng">特价</label>
                      <input type="checkbox" id="viaPort" class="radio">
                      <label for="searchTypeRnd">直飞</label>
                    </div></td>
                </tr>
                <tr>
                  <th scope="row"><span class="t">城市</span></th>
                  <td><div class="cityInputWrap2">
                      <div class="qcbox qcity">
                        <div class="boxWrapper">
                          <div class="boxContainer" id="mainXI0">
                            <div class="sicon"></div>
                            <div style="clear:both"></div>
                          </div>
                        </div>
                        <input type="text" class="textbox flightinput" id="fromCity" />
                        <div class="popContainer"></div>
                      </div>
                      <span class="t2" style="line-height:normal;"> 到 </span>
                      <div class="qcbox qcity">
                                               <div class="boxWrapper">
                          <div class="boxContainer" id="mainXI1">
                            
                            <div class="sicon"></div>
                          
                          </div>
                        </div>
                        <input type="text" class="textbox flightinput" id="toCity" />
                        <div class="popContainer"></div>
                      </div>
                    </div></td>
                </tr>
                <tr>
                  <th scope="row"><span class="t">日期</span></th>
                  <td valign="top" class="dateInputWrap">
                    <div class="qcbox qdate fromD">
                      <div class="labelContainer"></div>
                      <div class="boxWrapper">
                        <div class="boxContainer" id="mainXI2">
                          <div class="sicon"></div>
                          <div style="clear:both"></div>
                        </div>
                      </div>
                      <%
		              	java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
		              	String today = sdf.format(new java.util.Date());
		              %>
                      <input type="text" class="textbox" id="fromDate" name="fromDate" onclick="WdatePicker({minDate:'<%=today %>',isShowClear:false,readOnly:true});" value="<%=today %>" />
                      <div class="popContainer"></div>
                    </div>
                    
                    <span class="startSth">
                    <input title="搜索" type="button" class="flightsearch" onclick="javascript:subForm();" value="搜索" />
                    </span></td>
                </tr>
                
                <tr id="fctr" style="display:none;">
                  <th scope="row"><span class="t">返程</span></th>
                  <td valign="top" class="dateInputWrap">
                    <div class="qcbox qdate fromD">
                      <div class="labelContainer"></div>
                      <div class="boxWrapper">
                        <div class="boxContainer" id="mainXI2">
                          <div class="sicon"></div>
                          <div style="clear:both"></div>
                        </div>
                      </div>
                      <input type="text" class="textbox" id="backDate" name="backDate" onclick="WdatePicker({minDate:'<%=today %>',isShowClear:false,readOnly:true});" value="<%=today %>" />
                      <div class="popContainer"></div>
                    </div>
                    
                    <span class="startSth">
                    </span></td>
                </tr>
                
              </tbody>
            </table>
            </form>
          </div>
        </div>
        <!-- <div class="searchBox intelFlightSearch intel">
          <div class="search_title">
            <h2 id="search_internal " class="Default"><span>国际机票</span></h2>
          </div>
          <div class="boxpad">
            <table cellspacing="0" cellpadding="0" class="tblSearch">
              <tbody>
                <tr>
                  <th><span class="t">方式</span></th>
                  <td><div class="methodWrap">
                      <input type="radio" name="searchType" id="searchTypeSng" value="OnewayFlight" checked="checked" class="radio">
                      <label for="searchTypeSng">单程</label>
                      <input type="radio" name="searchType" id="searchTypeRnd" value="RoundTripFlight" class="radio">
                      <label for="searchTypeRnd">往返</label>
                      <input type="radio" value="DealsFlight" id="searchTypeDeals" name="searchType" class="radio">
                      <label for="searchTypeDeals">特价</label>
                    </div></td>
                </tr>
                <tr>
                  <th scope="row"><span class="t">城市</span></th>
                  <td><div class="cityInputWrap2"> <span class="t"> 从 </span>
                      <div class="qcbox qcity">
                                               <div class="boxWrapper">
                          <div class="boxContainer" id="mainXI0">
                           
                            <div class="sicon"></div>
                            <div style="clear:both"></div>
                          </div>
                        </div>
                        <input type="text" class="textbox flightinput" placeholder="城市名"  name="fromCity" autocomplete="off">
                        <div class="popContainer"></div>
                      </div>
                      <span class="t2"> 到 </span>
                      <div class="qcbox qcity">
                                               <div class="boxWrapper">
                          <div class="boxContainer" id="mainXI1">
                            
                            <div class="sicon"></div>
                          
                          </div>
                        </div>
                        <input type="text" class="textbox flightinput" placeholder="城市名" name="toCity" autocomplete="off">
                        <div class="popContainer"></div>
                      </div>
                    </div></td>
                </tr>
                <tr>
                  <th scope="row"><span class="t">日期</span></th>
                  <td valign="top" class="dateInputWrap"><span id="dIpuntFrom" style="visibility: visible;" class="t">往</span>
                    <div class="qcbox qdate fromD">
                      <div class="labelContainer"></div>
                      <div class="boxWrapper">
                        <div class="boxContainer" id="mainXI2">
                                                    <div class="sicon"></div>
                          <div style="clear:both"></div>
                        </div>
                      </div>
                      <input type="text" class="textbox" placeholder="请输入出发日期" name="fromDate" autocomplete="off">
                      <div class="popContainer"></div>
                    </div></td>
                </tr>
                  
                <tr>
                  <th scope="row">&nbsp; </th>
                  <td class="dateInputWrap arriDate"><div id="arrivalDateDiv" style="display: none;"><span class="t" id="dInputTo">返</span>
									<div class="qcbox qdate toD">
										<div class="labelContainer"></div><div class="boxWrapper"><div class="boxContainer" id="mainXI3"><div class="sinfo" id="sinfoXI3" title="">情人节后2天</div><div class="sicon"></div><div style="clear:both"></div></div></div><input type="text" class="textbox" name="toDate" autocomplete="off">
									<div class="popContainer"></div></div>
								</div>
                  
                    <span class="startSth">
                    <button title="搜索" type="submit" class="flightsearch"><span>搜 索</span></button>
                    </span></td>
                    
                </tr>
              </tbody>
            </table>
          </div>
        </div> -->
      </div>
      
      <!-- <div class="jp_tejia">
        <div id="ct_content" class="tj_title">
          <h1>特价机票</h1>
          <ul name="citylist" class="jp_ul">
            <li class="active"><a href="#">所有</a></li>
            <li><a href="#">上海</a></li>
            <li><a href="#">北京</a></li>
            <li><a href="#">广州</a></li>
            <li><a href="#">厦门</a></li>
            <li><a href="#">天津</a></li>
            <li><a href="#">长春</a></li>
            <li><a href="#">深圳</a></li>
            <li><a href="#">武汉</a></li>
            <li><a href="#">更多>></a></li>
          </ul>
        </div>
        <div id="tj_content" name="hot_tejia" class="tj_content">
          <h3 class="TitleH3"><span class="tishi">以下数据每5分钟自动更新</span>上海<span style="color:#EE7818;">1折</span>机票</h3>
          <ul class="tj_ul">
            <li> <a href="" date="2011-12-26"> <span style="width:45px;">12-26</span> <span style="width:80px;">上海-青岛</span> <span style="width:45px;">1.4折</span> <span style="color:#EE7818;">¥97</span> </a> </li>
            <li> <a href="/shanghai-dalian.html?2011-12-20&amp;referprice=1_99" price="99" date="2011-12-20"> <span style="width:45px;">12-20</span> <span style="width:80px;">上海-大连</span> <span style="width:45px;">1折</span> <span style="color:#EE7818;">¥99</span> </a> </li>
            <li> <a href="/shanghai-dalian.html?2011-12-22&amp;referprice=1_99" price="99" date="2011-12-22"> <span style="width:45px;">12-22</span> <span style="width:80px;">上海-大连</span> <span style="width:45px;">1折</span> <span style="color:#EE7818;">¥99</span> </a> </li>
            <li> <a href="/shanghai-shijiazhuang.html?2011-12-24&amp;referprice=1_99" price="99" date="2011-12-24"> <span style="width:45px;">12-24</span> <span style="width:80px;">上海-石家庄</span> <span style="width:45px;">1折</span> <span style="color:#EE7818;">¥99</span> </a> </li>
            <li> <a href="/shanghai-shijiazhuang.html?2011-12-29&amp;referprice=1_99" price="99" date="2011-12-29"> <span style="width:45px;">12-29</span> <span style="width:80px;">上海-石家庄</span> <span style="width:45px;">1折</span> <span style="color:#EE7818;">¥99</span> </a> </li>
            <li> <a href="/shanghai-jinan.html?2011-12-20&amp;referprice=1_130" price="130" date="2011-12-20"> <span style="width:45px;">12-20</span> <span style="width:80px;">上海-济南</span> <span style="width:45px;">1.8折</span> <span style="color:#EE7818;">¥130</span> </a> </li>
            <li> <a href="/shanghai-jinan.html?2011-12-21&amp;referprice=1_130" price="130" date="2011-12-21"> <span style="width:45px;">12-21</span> <span style="width:80px;">上海-济南</span> <span style="width:45px;">1.8折</span> <span style="color:#EE7818;">¥130</span> </a> </li>
            <li> <a href="/shanghai-tianjin.html?2011-12-18&amp;referprice=1_157" price="157" date="2011-12-18"> <span style="width:45px;">12-18</span> <span style="width:80px;">上海-天津</span> <span style="width:45px;">1.6折</span> <span style="color:#EE7818;">¥157</span> </a> </li>
            <li> <a href="/shanghai-changsha.html?2011-12-26&amp;referprice=1_157" price="157" date="2011-12-26"> <span style="width:45px;">12-26</span> <span style="width:80px;">上海-长沙</span> <span style="width:45px;">1.8折</span> <span style="color:#EE7818;">¥157</span> </a> </li>
            <li> <a href="/shanghai-tianjin.html?2011-12-17&amp;referprice=1_159" price="159" date="2011-12-17"> <span style="width:45px;">12-17</span> <span style="width:80px;">上海-天津</span> <span style="width:45px;">1.6折</span> <span style="color:#EE7818;">¥159</span> </a> </li>
            <li> <a href="/shanghai-xiamen.html?2012-02-05&amp;referprice=1_159" price="159" date="2012-02-05"> <span style="width:45px;">02-05</span> <span style="width:80px;">上海-厦门</span> <span style="width:45px;">1.7折</span> <span style="color:#EE7818;">¥159</span> </a> </li>
            <li> <a href="/shanghai-xiamen.html?2012-02-11&amp;referprice=1_159" price="159" date="2012-02-11"> <span style="width:45px;">02-11</span> <span style="width:80px;">上海-厦门</span> <span style="width:45px;">1.7折</span> <span style="color:#EE7818;">¥159</span> </a> </li>
            <li> <a href="/shanghai-changsha.html?2011-12-19&amp;referprice=1_159" price="159" date="2011-12-19"> <span style="width:45px;">12-19</span> <span style="width:80px;">上海-长沙</span> <span style="width:45px;">1.8折</span> <span style="color:#EE7818;">¥159</span> </a> </li>
            <li> <a href="/shanghai-jingjiang.html?2011-12-28&amp;referprice=1_159" price="159" date="2011-12-28"> <span style="width:45px;">12-28</span> <span style="width:80px;">上海-泉州</span> <span style="width:45px;">1.8折</span> <span style="color:#EE7818;">¥159</span> </a> </li>
            <li> <a href="/shanghai-jingjiang.html?2012-01-30&amp;referprice=1_159" price="159" date="2012-01-30"> <span style="width:45px;">01-30</span> <span style="width:80px;">上海-泉州</span> <span style="width:45px;">1.8折</span> <span style="color:#EE7818;">¥159</span> </a> </li>
            <li> <a href="/shanghai-lanzhou.html?2011-12-18&amp;referprice=1_197" price="197" date="2011-12-18"> <span style="width:45px;">12-18</span> <span style="width:80px;">上海-兰州</span> <span style="width:45px;">1.2折</span> <span style="color:#EE7818;">¥197</span> </a> </li>
            <li> <a href="/shanghai-shenyang.html?2011-12-24&amp;referprice=1_197" price="197" date="2011-12-24"> <span style="width:45px;">12-24</span> <span style="width:80px;">上海-沈阳</span> <span style="width:45px;">1.6折</span> <span style="color:#EE7818;">¥197</span> </a> </li>
            <li> <a href="/shanghai-huhehaote.html?2012-02-09&amp;referprice=1_199" price="199" date="2012-02-09"> <span style="width:45px;">02-09</span> <span style="width:80px;">上海-呼和浩特</span> <span style="width:45px;">1.5折</span> <span style="color:#EE7818;">¥199</span> </a> </li>
            <li> <a href="/shanghai-shenyang.html?2011-12-22&amp;referprice=1_199" price="199" date="2011-12-22"> <span style="width:45px;">12-22</span> <span style="width:80px;">上海-沈阳</span> <span style="width:45px;">1.6折</span> <span style="color:#EE7818;">¥199</span> </a> </li>
            <li> <a href="/shanghai-xian.html?2012-02-08&amp;referprice=1_199" price="199" date="2012-02-08"> <span style="width:45px;">02-08</span> <span style="width:80px;">上海-西安</span> <span style="width:45px;">1.6折</span> <span style="color:#EE7818;">¥199</span> </a> </li>
            <li> <a href="/shanghai-lanzhou.html?2011-12-19&amp;referprice=1_297" price="297" date="2011-12-19"> <span style="width:45px;">12-19</span> <span style="width:80px;">上海-兰州</span> <span style="width:45px;">1.7折</span> <span style="color:#EE7818;">¥297</span> </a> </li>
          </ul>
        </div>
      </div> -->
    </div>
    
  </div>
  
</div>

<script type="text/javascript">
var subForm=function(){
	if($('_fromCity').value==''){
		alert('请填写完整 出发地');
		return;
	}
	if($('_toCity').value==''){
		alert('请填写完整 目的地');
		return;
	}
	if($('fromDate').value==''){
		alert('请填写日期');
		return;
	}
	
	$('_viaPort').value=($('viaPort').checked?'1':'0');
	$('_isTj').value=($('isTj').checked?'1':'0');
	document.getElementById('subForm').submit();
};

var options = {
	script:'<%=request.getContextPath() %>/json/query!flightCity.action?',
	varname:'k',
	meth:'post',
	json:true,
	shownoresults:false,
	maxresults:10,
	clickOneResult:1,
	callback: function (obj) { document.getElementById('_fromCity').value = obj.id; }
};
new bsn.AutoSuggest('fromCity', options);

var options2 = {
	script:'<%=request.getContextPath() %>/json/query!flightCity.action?',
	varname:'k',
	meth:'post',
	json:true,
	shownoresults:false,
	maxresults:10,
	clickOneResult:1,
	callback: function (obj) { document.getElementById('_toCity').value = obj.id; }
};
new bsn.AutoSuggest('toCity', options2);

var changeFlyType=function(t){
	$('fctr').setStyle('display',t==1?'none':'block');
}

var writeBack_flight=function(fromPort,toPort,airline,flight_number,flight_time,arrive_time){
	if(window.opener){
		window.opener.writeBack_flight(fromPort,toPort,airline,flight_number,flight_time,arrive_time);
	}
}
</script>
</body>
</html>